package com.tester;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;

import com.object.Controller;
import com.object.HeroSprite;
import com.object.InputController;

/**
 * @author Erick Zanardo
 */
public class HeroInputGameTester extends BasicGame{
    private HeroSprite go;
    
    public HeroInputGameTester(String title) {
        super(title);
    }

    public void init(GameContainer gameContainer) throws SlickException {
        go = new HeroSprite();
        Controller control = new InputController(go, gameContainer.getInput());
        go.setController(control);
    }

    public void update(GameContainer gameContainer, int delta) throws SlickException {
        go.updateHero(delta);
    }

    public void render(GameContainer gameContainer, Graphics graphics) throws SlickException {
        go.drawHero();
    }

    public static void main(String[] args) throws SlickException {
        AppGameContainer app = new AppGameContainer(new HeroInputGameTester("Teste"));
        app.start();
    }
}
